import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView,
    },
    {
      path: '/index',
      name: 'index',
      component: () => import('../views/Index.vue'),
      children: [
        {
          path: '/user',
          component: ()=> import('../components/User.vue'),
          meta: { title: '用户表' }
        },
        {
          path: '/car',
          component: ()=> import('../components/Car.vue'),
          meta: { title: '汽车表' }
        },
        {
          path: '/driver',
          component: ()=> import('../components/Driver.vue'),
          meta: { title: '司机表' }
        },
        {
          path: '/price',
          component: ()=> import('../components/Price.vue'),
          meta: { title: '价格表' }
        },
                {
          path: '/order',
          component: ()=> import('../components/Order.vue'),
          meta: { title: '订单表' }
        },

      ],
    },
  ],
})

export default router
